From a5e85a12bd305868375e17dec7ab4add64beb325 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 19 Jun 2006 21:15:29 +0000 Subject: [PATCH] Reduce Magellan read timeout to 5 tries. Treat "-" on UNIX as a file, not a serial port. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2168 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/magproto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gpsbabel/magproto.c b/gpsbabel/magproto.c index 10ea3fe5a..b21365558 100644 --- a/gpsbabel/magproto.c +++ b/gpsbabel/magproto.c @@ -266,7 +266,7 @@ static void mag_writemsg(const char * const buf) { unsigned int osum = mag_checksum(buf); - int retry_cnt = 20; + int retry_cnt = 5; int i; char obuf[1000]; @@ -671,7 +671,7 @@ terminit(const char *portname, int create_ok) magfile_in = xfopen(portname, "rb", MYNAME); - is_file = !isatty(fileno(magfile_in)) || explorist; + is_file = (0 == strcmp(portname,"-")) || !isatty(fileno(magfile_in)) || explorist; if (is_file) { icon_mapping = map330_icon_table; mag_cleanse = m330_cleanse; @@ -840,7 +840,7 @@ mag_wr_init_common(const char *portname) } #else magfile_out = xfopen(portname, "w+b", MYNAME); - is_file = !isatty(fileno(magfile_out)) || explorist; + is_file = (0 == strcmp(portname,"-")) || !isatty(fileno(magfile_out)) || explorist; #endif if (!mkshort_handle) { -- 2.30.2